home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / file / managers / mc-3.2 / mc-3 / mc-3.2.1 / src / wtools.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-17  |  2.2 KB  |  82 lines

  1. #ifndef __WTOOLS_H
  2. #define __WTOOLS_H
  3.  
  4. /* Listbox utility functions */
  5. typedef struct {
  6.     Dlg_head *dlg;
  7.     WListbox *list;
  8. } Listbox;
  9.  
  10. Listbox *create_listbox_window (int cols, int lines, char *title, char *help);
  11. #define LISTBOX_APPEND_TEXT(l,h,t,d) \
  12.     listbox_add_item (l->list, 0, h, t, d);
  13.  
  14. int run_listbox (Listbox *l);
  15.  
  16. /* Quick Widgets */
  17. enum {
  18.     quick_end, quick_checkbox, 
  19.     quick_button, quick_input,
  20.     quick_label, quick_radio
  21. } /* quick_t */;
  22.  
  23. /* The widget is placed on relative_?/divisions_? of the parent widget */
  24. /* Please note that the contents of the fields in the union are just */
  25. /* used for setting up the dialog.  They are a convenient place to put */
  26. /* the values for a widget */
  27.  
  28. typedef struct {
  29.     int widget_type;
  30.     int relative_x;
  31.     int x_divisions;
  32.     int relative_y;
  33.     int y_divisions;
  34.  
  35.     char *text;            /* Text */
  36.     int  hotkey;        /* hotkey */
  37.     int  hotkey_pos;        /* the hotkey position */
  38.     int  value;            /* Buttons only: value of button */
  39.     int  *result;        /* Checkbutton: where to store result */
  40.     char **str_result;        /* Input lines: destination  */
  41.     WLay layout;        /* XView Layouting stuff */
  42.     char *tk_frame;        /* Tk: frame name, if the value is
  43.                  * zero, then it calls tk_end_frame
  44.                  */
  45.     void *the_widget;        /* For the quick quick dialog manager */
  46. } QuickWidget;
  47.     
  48. typedef struct {
  49.     int  xlen, ylen;
  50.     int  xpos, ypos; /* if -1, then center the dialog */
  51.     char *title;
  52.     char *help;
  53.     char *class;        /* Used for Tk's class name */
  54.     QuickWidget *widgets;
  55. } QuickDialog;
  56.  
  57. int quick_dialog (QuickDialog *qd);
  58. int quick_dialog_skip (QuickDialog *qd, int nskip);
  59.  
  60. /* Choosers */
  61.  
  62. #define CHOOSE_EDITABLE  1
  63. #define CHOOSE_BROWSE    0
  64.  
  65. /* Chooser dialog boxes */
  66. typedef struct {
  67.     Dlg_head *dialog;
  68.     WListbox *listbox;
  69. } Chooser;
  70.  
  71. Chooser *new_chooser (int lines, int cols, char *help, int flags);
  72. int run_chooser (Chooser *c);
  73. void destroy_chooser (Chooser *c);
  74.  
  75. /* The input dialogs */
  76. char *input_dialog (char *header, char *text, char *def_text);
  77. char *input_dialog_help (char *header, char *text, char *help, char *def_text);
  78. char *input_expand_dialog (char *header, char *text, char *def_text);
  79.  
  80. void query_set_sel (int new_sel);
  81. #endif    /* __WTOOLS_H */
  82.